import request from '@/config/axios'

export interface MetalPriceConfigVO {
  id: number
  userId: number
  configType: string
  auPrice: number
  ptPrice: number
  pdPrice: number
  agPrice: number
  auSalePrice: number
  ptSalePrice: number
  pdSalePrice: number
  agSalePrice: number
  au9999Price: number
  au999Price: number
  au900Price: number
  au916Price: number
  au750Price: number
  au585Price: number
  pt990Price: number
  pt950Price: number
  pt900Price: number
  pd990Price: number
  pd950Price: number
  ag999Price: number
  ag925Price: number
}

// 查询金属价格配置分页
export const getMetalPriceConfigPage = async (params) => {
  return await request.get({ url: `/along/metal-price-config/page`, params })
}

// 查询金属价格配置详情
export const getMetalPriceConfig = async (id: number) => {
  return await request.get({ url: `/along/metal-price-config/get?id=` + id })
}

// 新增金属价格配置
export const createMetalPriceConfig = async (data: MetalPriceConfigVO) => {
  return await request.post({ url: `/along/metal-price-config/create`, data })
}

// 修改金属价格配置
export const updateMetalPriceConfig = async (data: MetalPriceConfigVO) => {
  return await request.put({ url: `/along/metal-price-config/update`, data })
}

// 删除金属价格配置
export const deleteMetalPriceConfig = async (id: number) => {
  return await request.delete({ url: `/along/metal-price-config/delete?id=` + id })
}

// 导出金属价格配置 Excel
export const exportMetalPriceConfig = async (params) => {
  return await request.download({ url: `/along/metal-price-config/export-excel`, params })
}